package com.kk.jtq.springbootjt;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 事件监听器
 *
 * @author little_lunatic
 * @date 2023-02-28
 */
@Component
public class DiyEventListener {

    // 传入事件对象
    @EventListener
    public void display(ApplicationEvent event) {
        if (event instanceof DiyEvent) {
            System.out.println("receive event=== " + event);
        }
    }
}
